import {memberList} from '../../../request/api'

const state={
    memberlist:[]
}

const getters={
    getMemberList(state){
        return state.memberlist
    }
}

const mutations={
    REQ_MEMBERLIST(state,payload){
        state.memberlist=payload
    }
}

const actions={
    // 获取列表
    getMemberListAction({commit}){
        // 调用接口
        memberList().then(res=>{
            if(res.code==200){
                commit('REQ_MEMBERLIST',res.list)
            }
        })
    }
}

export default{
    state,
    getters,
    mutations,
    actions,
    // 命名空间
    namespaced:true
}